home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1995 #5 & #6 / Amiga Plus CD - 1995 - No. 5 and 6.iso / pd / serien / purity / nr.10 / demo / sparx.i / .spark08.i < prev    next >
Text File  |  1995-04-19  |  2KB  |  96 lines

  1.  
  2. Procedure Spark08;
  3. Const
  4.     max4lines = 2000;
  5.  
  6.     add1 : Short = 7;    { x1 }
  7.     add2 : Short = 3;    { y1 }
  8.     add3 : Short = 13;    { x2 }
  9.     add4 : Short = 7;    { y2 }
  10.  
  11.  
  12. Type
  13.     Sp1lines    = Array[1..max4lines] of line;
  14.     Sp1LinesPtr = ^Sp1Lines;
  15.  
  16. Var
  17.     arr    : Sp1LinesPtr;
  18.     cnt1,
  19.     cnt2,
  20.     cnt3,
  21.     cnt4,
  22.     CCNT,
  23.     numlines,
  24.     actualline : Short;
  25.  
  26. Procedure Inner8spark;
  27. Begin
  28.         EraseLine( Adr(arr^[actualline]) );
  29.         With arr^[actualline] do begin
  30.           x1 := 170 + XSin^[cnt1] *  6 DIV  5;    { +- max.120 }
  31.           y1 := 110 + Xsin^[cnt2] * 11 DIV 10;    { +- max.110 }
  32.           x2 := 160 + XSin^[cnt3] *  7 DIV  5;    { +- max.140 }
  33.           y2 := 120 + Xsin^[cnt4];            { +- max.100 }
  34.         end;
  35.  
  36.         cnt1 := cnt1 + add1;
  37.         if cnt1>627 then cnt1:= cnt1-628;
  38.  
  39.         cnt2 := cnt2 + add2;
  40.         if cnt2>627 then cnt2:= cnt2-628;
  41.  
  42.         cnt3 := cnt3 + add3;
  43.         if cnt3>627 then cnt3:= cnt3-628;
  44.  
  45.         cnt4 := cnt4 + add4;
  46.         if cnt4>627 then cnt4:= cnt4-628;
  47.  
  48.         DrawLine( Adr(arr^[actualline]), CCNT );
  49.  
  50.         inc( CCNT );
  51.         If CCNT > maxColors then CCNT := 2;
  52. End;
  53.  
  54.  
  55.  
  56. Begin
  57.     New(arr);
  58.     ActualLine := 1;
  59.  
  60.     cnt1 := 546;    cnt2 := 3;
  61.     cnt3 := 197;    cnt4 := 401;
  62.     CCNT := 1;    { color }
  63.     NumLines := 1;
  64.  
  65.  
  66.     Repeat
  67.       Inner8spark;
  68.  
  69.       inc( actualline );
  70.       If actualline >= numLines then actualline := 1;
  71.     Until LeftMouseButton;
  72.  
  73.     Repeat
  74.     Until not LeftMouseButton;
  75.     Delay(10);
  76.  
  77.     Repeat
  78.       Inner8spark;
  79.  
  80.       numlines:=512;
  81.  
  82.       inc( actualline );
  83.       If actualline > numLines then begin
  84.         actualline := 1;
  85. {        inc(numLines);
  86.         If numlines > maxlines then numlines:=1; }
  87.       end;
  88.  
  89.     Until LeftMouseButton;
  90.  
  91.     Ciao;
  92.     Dispose(arr);
  93.     SetSColors( Adr(Def_Colors) );
  94. End;
  95.  
  96.